package com.cybertron.am.wordpress;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinWorkerThread;

/**
 * @author xiezhouyan
 */
public class Constants {
    /**
     * 公共线程池
     */
    public static final ForkJoinPool POOL = new ForkJoinPool(10, pool -> {
        final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool);
        worker.setName("work-thread-" + worker.getPoolIndex());
        return worker;
    }, null, false);

    public static final String TABLE_NAME_PREFIX = "aw_";
    public static final String HTTPS_PREFIX = "https://";

    public static class Woocommerce {
        public static final String WOO_CONSUMER_KEY = "ck_a6dcc64339b4a95edc680519c1b83d954a3319c9";
        public static final String WOO_CONSUMER_SECRET = "cs_a4b514e95c5e415a92d13aace50c4e368f04498f";
        public static final String WOO_COMMERCE_SCOPE = "read_write";
        public static final String WOO_COMMERCE_AUTH_URL = "/wc-auth/v1/authorize";
        public static final String WOO_INDEX_URL = "/wp-json/wc/v3";
        public static final String WOO_PRODUCT_URL = "/wp-json/wc/v3/products";

        public static final String WOO_CATEGORY_URL = "/wp-json/wc/v3/products/categories";
        public static final String WOO_ORDER_URL = "/wp-json/wc/v3/orders";
        public static final String WOO_VARIANT_URL = "/wp-json/wc/v3/products/%s/variations";
        public static final String WOO_PRODUCT_ATTR_BATCH_OPERATION_URL = "/wp-json/wc/v3/products/attributes/batch";
        public static final String WOO_PRODUCT_VARIANT_BATCH_OPERATION_URL = "/wp-json/wc/v3/products/%s/variations/batch";
    }

}
